package com.auxgroup.hr.front.site.co.common;

import java.util.List;

import javax.annotation.Resource;

import com.auxgroup.hr.front.site.co.BaseCO;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.auxgroup.hr.front.commons.BaseRetCode;
import com.auxgroup.hr.front.commons.vo.BaseResponseVO;
import com.auxgroup.hr.front.dao.domain.PsNidType1Vw;
import com.auxgroup.hr.front.dozer.IObjectMapper;
import com.auxgroup.hr.front.service.personnal.NidType1VwService;
import com.auxgroup.hr.front.site.co.BaseCO;

/**
 * 证件类型CO
 * @author wangchangyun
 * @version 创建时间：180527 
 */
@RestController
@RequestMapping("${auxgroup.hr.contextPath}/nidType1Vw")
public class NidType1VwCO extends BaseCO {

	private static final Logger logger = LoggerFactory.getLogger(NidType1VwCO.class);

	@Autowired
	public NidType1VwService nidType1VwService;

	@Resource(name = "dozerMapper")
	protected IObjectMapper objectMapper;

	/**
	 * 获取证件类型
	 * @param hireId
	 * @return
	 */
	@GetMapping(value = "/getOne")
	public BaseResponseVO getOne(String nationalIdType) {
		logger.info("getNidType1Vw param= {}", nationalIdType);
		if(StringUtils.isBlank(nationalIdType)){
			buildRespone(BaseRetCode.CODE_ERROR_REQUEST_PARAM_NULL);
		}
		PsNidType1Vw nidType1Vw = nidType1VwService.getNidType1Vw(nationalIdType);
		return buildRespone(nidType1Vw,false);
	}
	
	
	/**
	 * 获取全部证件类型
	 * @param rsHireId
	 * @return
	 */
	@GetMapping(value = "/getAll")
	public BaseResponseVO getAll(){
		List<PsNidType1Vw> list = nidType1VwService.getAll();
		return buildRespone(list,false);
	}
	
	

}
